<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>组件配置配置-textarea</title>
        <{$showjs}>
        <link rel="stylesheet" type="text/css" href="../css/main1.css" />
        <style>
            .x-check-group-alt {
                background: #D1DDEF;
                border-top:1px dotted #B5B8C8;
                border-bottom:1px dotted #B5B8C8;
            }
        </style>
        <script language="javascript">
            Ext.onReady(function(){
                Ext.QuickTips.init();
                Ext.form.Field.prototype.msgTarget = 'side';
                var myMask = new Ext.LoadMask(Ext.getBody(), {
                    msg: '请稍候...',
                    removeMask: true //完成后移除
                });
                var fp = new Ext.FormPanel({
                    frame: true,
                    //        title:'权限组设置 [Right Group Config]',
                    labelWidth: 110,
                    width: Ext.getBody().getWidth(),
                    renderTo:'form-ct',
                    bodyStyle: 'padding:0 10px 0;',
        
                    items: [{
                            xtype:'fieldset',
                            title: '自身配置',
                            autoHeight: true,
                            layout: 'form',
                            items: [{
                                    xtype: 'radiogroup',
                                    fieldLabel: '旗帜选择',
                                    itemCls: 'x-check-group-alt',
                                    items: [
                                        {boxLabel: '<img src="../img/flag_blue.png">', name:"paixu",inputValue:'flag_blue.png'<{if $cfg.paixu=='flag_blue.png'||$cfg.paixu==''}>,checked: true<{/if}>},
                                        {boxLabel: '<img src="../img/flag_red.png">', name:"paixu",inputValue:'flag_red.png'<{if $cfg.paixu=='flag_red.png'}>,checked: true<{/if}>},
                                        {boxLabel: '<img src="../img/flag_yellow.png">', name: "paixu",inputValue:'flag_yellow.png'<{if $cfg.paixu=='flag_yellow.png'}>,checked: true<{/if}>},
                                        {boxLabel: '<img src="../img/flag_orange.png">', name: "paixu",inputValue:'flag_orange.png'<{if $cfg.paixu=='flag_orange.png'}>,checked: true<{/if}>},
                                        {boxLabel: '<img src="../img/flag_pink.png">', name: "paixu",inputValue:'flag_pink.png'<{if $cfg.paixu=='flag_pink.png'}>,checked: true<{/if}>},
                                        {boxLabel: '<img src="../img/flag_purple.png">', name: "paixu",inputValue:'flag_purple.png'<{if $cfg.paixu=='flag_purple.png'}>,checked: true<{/if}>}
                                    ]
                                },{
                                    xtype: 'checkboxgroup',
                                    fieldLabel: '打勾配置',
                                    itemCls: 'x-check-group-alt',
                                    items: [
                                        {boxLabel: '充许排序', name: 'cfg[px]',inputValue:1<{if $cfg.px=='1' }>,checked: true<{/if}>},
                                        {boxLabel: '高级搜索', name: 'gj',inputValue: 1<{if $fld.gj=='1'}>,checked: true<{/if}>},
                                        {boxLabel: '转译打开', name: 'zy',inputValue: 1<{if $fld.zy=='1'}>,checked: true<{/if}>},
                                        {boxLabel: '屏蔽显示', name: 'xr',inputValue:1<{if $fld.xr=='1'}>,checked: true<{/if}>}
                                    ]
                                }]
                        },{
                            xtype: 'fieldset',
                            title: '旗帜标识',
                            autoHeight: true,
                            items: [{
                                    xtype: 'textfield',
                                    name: 'cfg[bs0]',
                                    itemCls: 'x-check-group-alt',
                                    fieldLabel: '点灭标识（值0）'<{if $cfg.bs0=='' }>,value:"不推荐"<{else}>,value:"<{$cfg.bs0}>"<{/if}>,
                                    width:200
                            },{
                                xtype: 'textfield',
                                name: 'cfg[bs1]',
                                itemCls: 'x-check-group-alt',
                                fieldLabel: '点亮标识（值1）'<{if $cfg.bs1=='' }>,value:"推荐中"<{else}>,value:"<{$cfg.bs1}>"<{/if}>,
                                width:200
                            },{
                                xtype: 'radiogroup',
                                fieldLabel: '旗帜默认选中',
                                itemCls: 'x-check-group-alt',
                                width:160,
                                items: [
                                        {boxLabel: '<img src="../img/flag.png">', name:'mr',inputValue:'0'<{if $cfg.mr=='0'||$cfg.mr==''}>,checked: true<{/if}>},
                                        {boxLabel: '<img src="../img/flag_red.png">', name:'mr',inputValue:'1'<{if $cfg.mr=='1'}>,checked: true<{/if}>}
                                    ]
                            }]
                        },{
                            xtype:'fieldset',
                            title: '虚拟参数设置',
                            autoHeight: true,
                            items: [{
                                    itemCls: 'x-check-group-alt',
                                    allowBlank: false,
                                    layout:'form',
                                    items: [{
                                            xtype: 'textarea',
                                            fieldLabel: 'STR[JSON]{,结尾,否则不显示,此处是EXTJS式的JSON配置.}',
                                            name:'cfg[STR]',
                                            width:200,
                                            value:'<{$cfg.STR}>'
                                        }]
                                }]
                        },{
                            xtype:'fieldset',
                            title: '通用配置',
                            autoHeight: true,
                            items: [{
                                    itemCls: 'x-check-group-alt',
                                    allowBlank: false,
                                    layout:'column',
                                    items: [{
                                            columnWidth: '.33',
                                            bodyStyle: 'padding:0 10px 0;',
                                            labelWidth:60,
                                            layout:'form',
                                            items: [
                                                {html:"<font color='red'><b>默认值<hr></b></font>"},
                                                {xtype: 'combo',value:'<{if $fld.qzfs==''}>1<{else}><{$fld.qzfs}><{/if}>',fieldLabel:'取值方式',blankText:'...不能为空',style:'text-align:left',mode: 'local',forceSelection: true,triggerAction: 'all',width: 90,editable: false,emptyText:'请选择...',valueField :'yinv',displayField:'xianv',store:new Ext.data.SimpleStore({fields:['yinv','xianv'],data:[['0','不变值'],['1','正常表单'],['function','function'],['$_GET','$_GET'],['$_POST','$_POST'],['$_SESSION','$_SESSION'],['$_COOKIE','$_COOKIE'],['$_SERVER','$_SERVER'],['$_ENV','$_ENV'],['$_FILES','$_FILES']]}),hiddenName: 'qzfs'},
                                                {xtype: 'textfield',name: 'blm',fieldLabel: '变量名',value:"<{$fld.blm}>",width:'80px'}
                                            ]},
                                        {
                                            columnWidth: '.33',
                                            bodyStyle: 'padding:0 10px 0;',
                                            labelWidth:40,
                                            layout:'form',
                                            items: [{
                                                    html:"<font color='red'><b>XY坐标<hr></b></font>"
                                                },{
                                                    xtype: 'textfield',
                                                    name: 'x',
                                                    fieldLabel: 'X轴',
                                                    value:'<{$fld.x}>',
                                                    width:'80px'},
                                                {
                                                    xtype: 'textfield',
                                                    name: 'y',
                                                    fieldLabel: 'Y轴',
                                                    value:'<{$fld.y}>',
                                                    width:'80px'}]
                                        },{
                                            columnWidth: '.33',
                                            bodyStyle: 'padding:0 10px 0;',
                                            labelWidth:40,
                                            layout:'form',
                                            items: [{
                                                    html:"<font color='red'><b>Z坐标<hr></b></font>"
                                                },{
                                                    xtype: 'textfield',
                                                    name: 'z',
                                                    fieldLabel: 'Z轴',
                                                    value:'<{$fld.z}>',
                                                    width:'80px'},{
                                                    xtype: 'hidden',
                                                    name: 'id',
                                                    value:'<{$fld.id}>'},{
                                                    xtype: 'hidden',
                                                    name: 'type',
                                                    value:'<{$fld.type}>'}]
                                        }]
                                }]
                        }],
        
                    buttons: [{
                            text: '保存',
                            handler: function(){
                                if(fp.getForm().isValid()){
                                    //Ext.Msg.alert('Submitted Values',fp.getForm().getValues(true).replace(/&/g,', '));
                                    myMask.show();
                                    fp.form.doAction('submit',{
                                        url:'fldcfg.php',
                                        method:'POST',
                                        params:{op:'save'},
                                        waitMsg:'正在提交....',
                                        success:function (response){
                                            myMask.hide();
                                            parent.Ext.getCmp('<{$fld.id}>').close();
                                            Ext.MessageBox.alert('信息提示','提交成功');
                                        },
                                        failure:function (response){
                                            Ext.MessageBox.alert('信息提示','提交失败');
                                        }
                                    });

                                }
                            }
                        },{
                            text: 'Reset',
                            handler: function(){
                                fp.getForm().reset();
                            }
                        }]
                });
            });
        </script>
    </head>
    <body>
        <div id="form-ct"></div>
    </body>
</html>
